<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>JavaScript do-while循环的简单应用</title>
    </head>
    <body>
        <h3>JavaScript do-while循环的简单应用</h3>
        <hr />
        <p>
	    	使用do-while循环计算1+2+3+...+10的总和。
        </p>
        <script>
			var i = 0;
			var sum = 0;
			do{
				sum += i;
				i++;			
			}while(i<=10);
			document.write("1+2+3+...+10 = "+sum);
        </script>
    </body>
</html>